package com.cn.wanxi.servlet.back.news;

import com.cn.wanxi.service.INewsTypeService;
import com.cn.wanxi.service.impl.NewsTypeServiceImpl;
import com.cn.wanxi.util.DataEncoding;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/back/news/type/show")
public class NewsTypeShowServlet extends HttpServlet {
    INewsTypeService newsTypeService = new NewsTypeServiceImpl();
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        DataEncoding.setTextContentType(resp);
        DataEncoding.setCharacterEncoding(req,resp);
        int id = Integer.parseInt(req.getParameter("id"));
        int show = Integer.parseInt(req.getParameter("show"));
        int result = newsTypeService.updateShow(id,show);
        resp.getWriter().print(result);
    }
}
